/*!
 * \file UapEventGapMediaBearerSetupCfm.h
 * \brief Event carrying message GapMediaBearerSetupConfirm
 */

#ifndef SGW_UAP_EVENT_GAP_MEDIA_BEARER_SETUP_CFM_H
#define SGW_UAP_EVENT_GAP_MEDIA_BEARER_SETUP_CFM_H

#include "EventData.h"
#include "UapGlobals.h"
#include "GAP.pb.h"
#include "common.pb.h"

namespace tsc
{
namespace sgw
{

using GatewayApplicationPart::GapMediaBearerSetupConfirm;
using ProtocolsCommon::IpAddress;

/**
 * The event indicating MediaGateway accepted requests to setup
 * media bearer
 * It carries received GapMediaBearerSetupCfm message
 */
class UapEventGapMediaBearerSetupCfm : public common::EventData
{
public:

    UapEventGapMediaBearerSetupCfm(
            uint32_t serverMediaPort,
            const IpAddress* serverMediaAddress) :
		EventData(UAP_GAP_MEDIA_BEARER_SETUP_CFM),
		mServerMediaPort(serverMediaPort),
		mServerAddress(0)
	{
        mServerAddress = new IpAddress(*serverMediaAddress);
	}

	virtual ~UapEventGapMediaBearerSetupCfm()
	{
	    delete mServerAddress;
	}

    uint32_t getServerMediaPort() const
    {
        return mServerMediaPort;
    }

    IpAddress* getServerMediaAddress() const
    {
        return mServerAddress;
    }

private:
	uint32_t   mServerMediaPort;
	IpAddress* mServerAddress;
};

} // namespace sgw
} // namespace tsc

#endif // SGW_UAP_EVENT_GAP_MEDIA_BEARER_SETUP_CFM_H
